package mybatis.mapper;

import mybatis.Utill.batisUtill;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class StuMapper {
    @Test
    public void testMethod(){
        SqlSession session = batisUtill.getSession();
        mybatis.mybatisMapper.StuMapper mapper = session.getMapper(mybatis.mybatisMapper.StuMapper.class);
        HashMap<String,Object> map = new HashMap<>();
        map.put("studentResult",80);
        map.put("subjectName","高等数学-1");
        map.put("address","南京");
        System.out.println(mapper.practiseFirstSelect(map));
        map.put("studentName","李文才");
        map.put("sex",1);
        System.out.println(mapper.selectStuByCondition(map));
        System.out.println(mapper.testTrimSelect(map));
        map.put("loginPwd",12345678);
        map.put("studentName","张三");
        map.put("studentno",1018);
        System.out.println("因updateTest受影响的行数:"+mapper.updateTest(map));
        List<Integer> numList = new ArrayList<>();
        numList.add(1003);
        numList.add(1001);
        numList.add(1013);
        System.out.println(mapper.selectStuByIds(numList));
    }
}
